/* Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 * 
 * 		Author: tThirday 
 * 		Please report bugs to http://eyecm.com.
 * 		Any problems, please leave messages on http://eyecm.com.
 */
package com.eyecm.example;

import java.util.List;

import com.eyecm.connector.GmailConnector;
import com.eyecm.connector.MsnConnector;
import com.eyecm.model.Contact;
import com.eyecm.model.User;


public class Example
{
	public static void output(List<Contact> contacts)
	{
		System.out.println("Total Contacts Count: " + contacts.size());
		for(Contact contact : contacts)
		{
			System.out.println(contact.getUsername()+" : "+contact.getEmail());
		}
	}
	
	public static void main(String[] args) throws Exception
	{
		User gmailUser = new User("XXX@gmail.com","XXX");
		GmailConnector gmail = new GmailConnector(gmailUser);
		
		// Print out contacts.
		Example.output(gmail.getContacts());
		
		User msnUser = new User("XXX@htomail.com","XXX");
		MsnConnector msn = new MsnConnector(msnUser);
		// Print out contacts.
		Example.output(msn.getContacts());
	}
}
